package startupweekend201311.recipe4u.fragment;

import startupweekend201311.recipe4u.R;
import android.app.Fragment;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class TodayRecipeFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return inflater.inflate(R.layout.flagment_recipe, container, false);
	}

	@Override
	public void onResume() {
		super.onResume();
		BitmapFactory.Options options = new BitmapFactory.Options();
        options.inSampleSize = 2;
        
		ImageView img = (ImageView)getActivity().findViewById(R.id.img_today);
		img.setImageDrawable(new BitmapDrawable(getResources(), 
				BitmapFactory.decodeResource(getResources(), R.drawable.img_02012, options)));
		//img.setImageResource(R.drawable.img_02012);
		
		TextView text = (TextView)getActivity().findViewById(R.id.txt_today_recipe);
		
		text.setText("たまご×1.5\n食パン×2\nぷちトマト×1\nハム×1");
	}
}
